﻿using Confluent.Kafka;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Zhaoxi.Protobuf
{
	class CustomStringIDeserializer<T> : IDeserializer<T>
	{
		//public T Deserialize(ReadOnlySpan<byte> data, bool isNull, SerializationContext context)
		//{
		//	Stream stream = new MemoryStream(data.ToArray());
		//	var info = ProtoBuf.Serializer.Deserialize<T>(stream);
		//	return info;
		//}
		public T Deserialize(ReadOnlySpan<byte> data, bool isNull, SerializationContext context)
		{
			Stream stream = new MemoryStream(data.ToArray());
			var info = ProtoBuf.Serializer.Deserialize<T>(stream);
			return info;

		}
	}
}
